home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / sunfonts / Font.h < prev    next >
C/C++ Source or Header  |  1992-02-06  |  900b  |  46 lines

  1. #define MAXCHARS 256
  2.  
  3. typedef unsigned char byte;
  4.  
  5. typedef struct {
  6.     char *name;
  7.     int width, swidth;
  8.     int up, down, left, right;
  9.     int nbytes, bytesperline;
  10.     byte *bits;
  11.     unsigned int attr;
  12. } Glyph;
  13.  
  14. typedef struct {
  15.     char *name, **props, **comments;
  16.     int size, resx, resy;
  17.     int nprops, ncomments;
  18.     int ascent, descent, defaultchar;
  19.     Glyph *glyphs[MAXCHARS];
  20. } Font;
  21.  
  22. #define max(a,b) ((a) > (b) ? (a) : (b))
  23.  
  24. extern char *malloc();
  25. extern Font *NewFont();
  26. extern void DumpAsBdf();
  27. extern Font *ReadBdf();
  28. extern char *strsave();
  29. extern void FreeFont();
  30. extern void FreeGlyph();
  31. extern char *adobename();
  32. extern void RemoveGlyph();
  33. extern void MaxExtent();
  34.  
  35. extern unsigned int mask[];
  36.  
  37. #define getbit(bp,bpl,x,y) ((bp)[(y)*(bpl) + ((x)>>3)] & mask[(x)&07])
  38.  
  39. #define putbit(bp,bpl,x,y) ((bp)[(y)*(bpl) + ((x)>>3)] |= mask[(x)&07])
  40.  
  41. #define Bytes(x) (((x)+7) >> 3)
  42.  
  43.  
  44.  
  45.  
  46.